# -------------------------------------------------------------------------------
# Description:  
# Reference:
# Name:   fundsStatistics
# Author: wujunchao
# Date:   2021/10/2
# -------------------------------------------------------------------------------
from pyhanlp import *

# 停用词表
f = open("hit_stopwords.txt",encoding="utf-8")
hit_stopwords = f.read().splitlines()

# CRF分词器分词
def CRFwork(words):
    CRFLexicalAnalyzer = JClass("com.hankcs.hanlp.model.crf.CRFLexicalAnalyzer")
    analyzer = CRFLexicalAnalyzer()
    result=[]
    for sentence in words:
        segList = analyzer.seg(sentence)
        for i in segList:
            i = i.word
            if(i in hit_stopwords):
                pass
            else:
                result.append(i)
        print(result)

words = ["人口健康、生态环境、公共安全、节能减排、循环经济、社会管理等与社会发展密切相关的重点领域。"]
CRFwork(words)